// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.enums;

/**
 * 库存状态枚举
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2022-05-25
 */
public enum InventoryStatusEnum {
    PROCESSED(0, "已处理"),
    NORMAL(1, "未过期"),
    ABOUT_TO_EXPIRE(2, "即将过期"),
    EXPIRED(3, "已过期");
    private int value;

    private String name;

    InventoryStatusEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getNameByValue(int value) {
        InventoryStatusEnum arrObj[] = InventoryStatusEnum.values();
        for (InventoryStatusEnum obj : arrObj) {
            if (value == obj.getValue()) {
                return obj.getName();
            }
        }
        return " ";
    }

}
